home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 15336 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: edmr54.ccinet.ab.ca!user
  2. From: d_martin@biomira.com (Douglas Martin)
  3. Newsgroups: comp.lang.c++,comp.lang.c
  4. Subject: Re: compiling problem under g++
  5. Date: 4 Apr 1996 22:56:33 GMT
  6. Organization: Biomira Inc.
  7. Message-ID: <d_martin-0404961602210001@edmr54.ccinet.ab.ca>
  8. References: <3161A2D3.7D84@psu.edu> <4jtsdm$hba@nadine.teleport.com>
  9. NNTP-Posting-Host: edmr54.ccinet.ab.ca
  10.  
  11. In article <4jtsdm$hba@nadine.teleport.com>, GHouck <hksys@teleport.com> wrote:
  12.  
  13. > "Jason A. Soloff" <jas251@psu.edu> wrote:
  14. ...
  15. > >
  16. > >OK... thats it... nice and simple huh?  Nope.
  17. > >Won't compile on two unix systems I am trying to work with...
  18. > >SunOS 4.1.3_U1, with g++ 2.4  It can't seem to find the
  19. > >sqrt code from the library?  Am I missing something?  is the
  20. > >library called something else under UNIX?
  21. > Jason,
  22. > If the '25' is truly an integer, perhaps that is the
  23. > problem, since there probably is no function available
  24. > to take the square root of an integer, but rather
  25. > a double.  Unless, of course, it casts it, then ...
  26. He said it couldn't find the code in the library, not that he got an error
  27. during compile time! In any case, the prototype for sqrt in <math.h> will
  28. ensure that the 25 gets coverted to a float.
  29.  
  30. In answer to the original question, you need to get the math library
  31. linked in; you probably didn't request it on the g++ command line
  32. (probably with -lm if it's like cc's I've used; check your man or info
  33. pages).
  34.  
  35. -- 
  36. Douglas Martin                 d_martin@biomira.com
  37. Clinical Support Programmer    dmartin@freenet.edmonton.ab.ca
  38. Biomira Inc.
  39. 2011 - 94 St. Edmonton
  40.